Skip to content

isSupportedQualifier() need not handle a null argument#7704

Open
mernst wants to merge 1 commit intotypetools:masterfrom
mernst:is-supported-qualifier-null-argument
Open

isSupportedQualifier() need not handle a null argument#7704
mernst wants to merge 1 commit intotypetools:masterfrom
mernst:is-supported-qualifier-null-argument

Conversation

@mernst
Copy link
Copy Markdown
Member

@mernst mernst commented May 4, 2026

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

📝 Walkthrough

Walkthrough

The isSupportedQualifier method in the AnnotatedTypeFactory class was updated to change its parameter contract. The method parameter changed from accepting a nullable AnnotationMirror to a non-null one, removing the @Nullable annotation. The associated @EnsuresNonNullIf contract annotation was also removed from the method declaration, and its import was deleted from the file. The internal null-handling logic was removed, and the method now directly canonicalizes the annotation by name and delegates to the string-based supported-qualifier lookup.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 6/8 reviews remaining, refill in 8 minutes and 54 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@framework/src/main/java/org/checkerframework/framework/type/AnnotatedTypeFactory.java`:
- Around line 3368-3373: Update the Javadoc for
AnnotatedTypeFactory.isSupportedQualifier(AnnotationMirror a) to explicitly
state that the parameter a must be non-null (e.g., "a non-null
AnnotationMirror") and document the NPE behavior (e.g., that the method will
throw NullPointerException if a is null). Keep the return description as-is and
optionally mention that callers should use AnnotationUtils.annotationName(a)
only with non-null inputs; reference the method name
isSupportedQualifier(AnnotationMirror) and the parameter name a in the Javadoc
to make the contract clear.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7c1c27b5-91d4-4ec5-9ba8-d0084136d4ce

📥 Commits

Reviewing files that changed from the base of the PR and between 417afa2 and d188882.

📒 Files selected for processing (1)
  • framework/src/main/java/org/checkerframework/framework/type/AnnotatedTypeFactory.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants